home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 2130 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  2.9 KB

  1. Path: noc.tor.hookup.net!the-fix.sos.on.ca
  2. From: <verneb@the-fix.sos.on.ca>
  3. Date: Thu,18 Jan 96 12:30:00 -0500
  4. Newsgroups: comp.lang.c
  5. Subject: ATTENTION C EXPERTS!! Extern Declarations - NEED H
  6. Message-ID: <tcpnntpd.16.1.18.12.30.0.2781597121.348422@the-fix.sos.on.ca>
  7. References: <dcd9516f@brazerko.com>
  8. Organization: the FIX - Kitchener, Ontario CANADA
  9. NNTP-Posting-Host: the-fix.sos.on.ca
  10. X-MajorTCP-Version: MajorTCP/IP [1.80-0]
  11.  
  12. To: INT:tcassel@brazerko.com
  13.  
  14. Int:tcassel@brazerko.com,
  15.     From page 551 of The New C Primer Plus,
  16.     The #ifndef directive commonly is used to prevent multiple 
  17. inclusions of a file.  That is, an include file may be set up along 
  18. the following lines:
  19.     
  20.     /* things.h */
  21.     #ifndef _THINGS_
  22.         #define _THINGS_
  23.     /* Rest of include file */
  24.     #endif
  25.     
  26.     Suppose this file somehow got included sevefal times.  The first 
  27. time the preprocessor encounters this include file, _THINGS_is 
  28. undefined, so the program proceeds to  define _THINGS_ and to procedss 
  29. the rest of the file.  The next time the preprocessor encounters this 
  30. file, _THINGS_ is defined, so the preprocessor skips the rest of the file.
  31.     
  32.     No where in my books can I find reference to #define _CDECL cdecl. 
  33.  In the back of my mind though I seem to recall reading something like 
  34. this in the "C" Manual for the Amiga where it referred to changing 
  35. value from one to another.  This could mean that whenever a Capital C 
  36. is punched a small c is used.  Hope this gives a little help.  If you 
  37. are desparate I could take a lengthy look in the old manual but there 
  38. is no index. 
  39.  
  40. I >I am having difficulty understanding the following code and every book I
  41. I >get on
  42. I >the subject does not explain the multiple MACROS that are in the
  43. I >definition.
  44. I >
  45. I >extern unsigned int _NEAR _CDECL _osversion;
  46. I >
  47. I >/* where _NEAR and _CDECL are macros defined as:*/
  48. I >
  49. I >#ifndef NO_KEYS
  50. I >    #define _CDECL cdecl
  51. I >    #define _NEAR near
  52. I >#else                  
  53. I >    #define _CDECL  
  54. I >    #define _NEAR   
  55. I >#endif 
  56. I >
  57. I >/* There is only two places where cdecl and near are mentioned in the rest
  58. I >of
  59. I >the program - the following appears once in two seperate header files */
  60. I >
  61. I >#define _NEAR near
  62. I >#define _CDECL cdecl
  63. I >
  64. I >/* I am attempting to make this program ansi C compilable, and am stuck on
  65. I >this
  66. I >as I dont understand what the above code is doing. Any help would be
  67. I >greatly
  68. I >appreciated. Kind Regards, Thea Cassel  tcassel@sisyphus.cit.gu.edu.au
  69. I >*/
  70. I >
  71. I >
  72. I >-- 
  73. I >.-----------------------------------------------------------------------.
  74. I >| The gateway is Brazerko Communications'; the opinions are the user's. |
  75. I >| sales@brazerko.com   info@brazerko.com ('bot)   +1 860 886 1441 (BBS) |
  76. I >`-----------------------------------------------------------------------'
  77. I >
  78.  
  79. Verne H. Bohlender
  80. Box 416, Chesley, Ontario.Ca. N0G 1L0
  81. verneb@The-Fix.sos.on.ca
  82. ___
  83. * UniQWK #2158*
  84.  
  85.